﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace NetworkSupervisor
{
    public partial class FormSearchExport : DevExpress.XtraEditors.XtraForm
    {
        public FormSearchExport()
        {
            InitializeComponent();
        }

        private void btnExport_Click(object sender, EventArgs e)
        {
            SaveFileDialog f = new SaveFileDialog();
            f.Filter = "Excel(*.xls)|*.xls";
            f.FileName = "处理信息分类导出列表" + DateTime.Now.ToString("yyyy年MM月dd日") + ".xls";
            if (f.ShowDialog() == DialogResult.OK)
            {
                gridControl2.ExportToXls(f.FileName);
                if (XtraMessageBox.Show("导出成功，是否打开？", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    System.Diagnostics.Process.Start(f.FileName);
                }
            }
        }

        private void gridView2_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
        {
            if (e.Info.IsRowIndicator)
            {
                e.Info.DisplayText = (e.RowHandle + 1).ToString();
            }
        }
    }
}